    .MODEL SMALL
    .DATA
TAB DB 0, 1, 4, 9, 16, 25, 36, 49, 64, 81
STRING DB 'Y final equals:','$'
ASC1 DB ?
ASC2 DB ?
X DB 8
Y DB ?
Y1 DB ?
    .CODE
    .STARTUP
    LEA BX, TAB  ;TAB地址传送
    MOV AL, X  ;查表第n位
    XLAT  ;查表，结果送AL
    MOV Y, AL  ;AL送Y
    ADD AL, 0
    DAA
    MOV Y1, AL

    LEA DX, STRING
    MOV AH, 09H
    INT 21H

    MOV AL, Y1
    AND AL, 0F0H
    MOV CL, 4
    ROL AL, CL
    OR AL, 30H
    MOV ASC1, AL
    MOV BL, Y1
    AND BL, 0FH
    OR BL, 30H
    MOV ASC2, BL
    MOV DL, AL
    MOV AH, 02H
    INT 21H
    MOV DL, BL
    MOV AH, 02H
    INT 21H

    .EXIT
    END